<template>
    <div style="height:75vh">
        <UserPickerComponent :list="userList"   ></UserPickerComponent>
        <span slot="footer" class="dialog-footer">
      <!-- <el-button @click="dialogVisible = false">取 消</el-button> -->
      <el-button type="primary" @click="closes">确 定</el-button>
  </span>
    </div>

</template>

<script>
    import UserPickerComponent from "./UserPickerComponent";
    export default {
        props:{
            list:Array,

            isShow:Object,
        },
        components:{
            UserPickerComponent
        },
        data(){
            return {
                activeName: 'second',
                userList:[],
                urlList:{
                    depList: '/dep/list',
                    getUserListbydid : '/user/getUsers',
                    roleList: "/role/list",
                }
            }
        },
        mounted(){
            this.userList = this.list
            // this.userList = [{... this.list}]
        },
        methods: {
            closes(){

                // let store = this.$refs.multipleTable.store.states.selection
                // store.forEach(element => {
                //     // console.log(element)
                //     if(this.list.length != 0){
                //         if(JSON.stringify(this.list).indexOf(JSON.stringify({true_name:element.true_name,id:element.id,username:element.username})) == -1){
                //             this.list.push({true_name:element.true_name,id:element.id,username:element.username})
                //         }
                //     }else{
                //         this.list.push({true_name:element.true_name,id:element.id,username:element.username})
                //     }
                // })
                console.log(this.userList)
                // this.list = this.userList;
                // for(let item of this.userList){
                //     this.list.push(item);
                // }
                console.log(this.list)
                this.isShow.state = false
            },
            loading(bool = true) {

                const loading = this.$loading({
                    lock: true,
                    text: '',
                    spinner: 'el-icon-loading',
                    background: 'rgba(255, 255, 255, 0.7)'
                });
                if(!bool){
                    loading.close();
                }
            }
        }
    }
</script>

<style scoped lang="less">

</style>